// reducers 是一个函数有返回值，参数有两个一个是（prestate actions）
import {INCREMENT, DECREMENT} from './action-types'
export default function reducerName (prestate = 0, { type, data }) {
  switch (type) {
    case INCREMENT:
      return prestate + data
    case DECREMENT:
      return prestate - data
    default:
      return prestate
  }
}